package cn.tlb;

import android.app.LauncherActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ArrayAdapter;

import cn.tlb.compoment.loader.LoaderDemoActivity;
import cn.tlb.gl.GLContents;
import cn.tlb.okhttp.OkhttpMainActivity;
import cn.tlb.retrofit.TestActivity;
import cn.tlb.ui.UIContents;
import cn.tlb.upload.FormSubmitActivity;
import cn.tlb.upload.UploadActivity;
import cn.tlb.xutilsdownload.annotation.AnnotationActivity;
import cn.tlb.xutilsdownload.contentshear.ShearActivity;
import cn.tlb.xutilsdownload.design.TabLayout_ViewpagerActivity;
import cn.tlb.xutilsdownload.http.HttpActivity;

/**
 * Created by 汤林冰 on 2015/11/24 09:25.
 */
public class Contents extends LauncherActivity {

    private String[] titles = {
            "TabLayout_Viewpager联动",
            "Http请求",
            "Shear Data",
            "自定义注解",
            "widget",
            "OpenGL Demo",
            "retrofit",
            "upload",
            "upload II",
            "okhttp",
            "android Loader"
    };

    private Class[] cls = {
            TabLayout_ViewpagerActivity.class,
            HttpActivity.class,
            ShearActivity.class,
            AnnotationActivity.class,
            UIContents.class,
            GLContents.class,
            TestActivity.class,
            UploadActivity.class,
            FormSubmitActivity.class,
            OkhttpMainActivity.class,
            LoaderDemoActivity.class
    };


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, titles));

//        new Handler().postDelayed(new Runnable() {
//            @Override
//            public void run() {
////                startService(new Intent(Contents.this, BackService.class));
//                Toast.makeText(Contents.this, "BackgroundService send Toast!", Toast.LENGTH_SHORT).show();
//            }
//        }, 5000);
    }

    @Override
    protected Intent intentForPosition(int position) {
        return new Intent(this, cls[position]);
    }
}
